/**
 * @file bitOption.c
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-11-05
 * 
 * @copyright Copyright (c) 2024
 * 
 */
#include "stdint.h"
#include "stdio.h"

#define BIT0 (1 << 0)
#define BIT1 (1 << 1)
#define BIT2 (1 << 2)
#define BIT3 (1 << 3)
#define BIT4 (1 << 4)
#define BIT5 (1 << 5)
#define BIT6 (1 << 6)
#define BIT7 (1 << 7)

static volatile uint8_t bvalue = 0xA5;

/**
 * @brief bit print
 * 
 * @param value 
 */
void print8Bit(uint8_t value)
{
	printf("%X\n",value);
	for (int i = 0; i < 8; i++)
	{
		printf("%d ",(value & 0x80) ? 1 : 0);
		value <<= 1;
		// value = value << 1;
	}
	printf("\n");
}
/**
 * @brief bit clean zero
 * 
 * @param bit 
 */
void cleanBitValue(uint8_t bit)
{
	bvalue &= ~bit;
}

/**
 * @brief bit set one
 * 
 * @param bit 
 */
void setBitValue(uint8_t bit)
{
	bvalue |= bit;
}

/**
 * @brief bit toggle value
 * 
 * @param bit 
 */
void toggleBitValue(uint8_t bit)
{
	bvalue ^= bit;
}

void checkBitValue(uint8_t bit)
{
	if (bvalue & bit)
	{
		//check bit is true
	}
	else
	{
		//check bit is false
	}
}
